package cc.telecomdigital.tdstock.activity.groups.more;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import cc.telecomdigital.tdstock.CommonDefn;
import cc.telecomdigital.tdstock.R;
import cc.telecomdigital.tdstock.Framework.UniqueItem.TDStockLog;
import cc.telecomdigital.tdstock.Tools.ActivityGroupController;
import cc.telecomdigital.tdstock.activity.groups.MoreGroup;

public class SoccerPhoneBettingActivity extends PhoneBettingBaseActivity
{

	private final static String	TAG	= SoccerPhoneBettingActivity.class
										.getSimpleName();

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);

		setContentView(R.layout.soccer_phone_betting_details);

		sharedPreferences = getSharedPreferences(
				CommonDefn.SYSTEM_CURRENT_SETTING, Context.MODE_PRIVATE);

		Button _toolBtnReturn = (Button) findViewById(R.id.more_returnbtn);

		_toolBtnReturn.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				TDStockLog.d(TAG, "close current activity and forwarding to the previous");

				Intent intent = new Intent(getApplicationContext(),
						MoreSettingActivity.class);
				intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP| Intent.FLAG_ACTIVITY_NO_USER_ACTION);
				
				SwitchForwardActivity(MoreActivity.class, intent);
				
			}

		});

		languages = getResources().getStringArray(
				R.array.more_setting_phone_betting_languages);

		rowIds = new int[] { R.id.row_1, R.id.row_2, R.id.row_3 };

		keyPhoneNumber = CommonDefn.PREFERENCE_SOCCER_PHONE_BETTING_NUMBER;

		keyCurrentIndex = CommonDefn.PREFERENCE_SOCCER_PHONE_BETTING_INDEX;

		TextView title = (TextView) findViewById(R.id.title);

		title.setText(R.string.more_setting_soccer_phone_betting);

		phoneBettingContent = getResources().getStringArray(
				R.array.more_setting_soccer_phone_betting_content);

		phoneBettingNumber = getResources().getStringArray(
				R.array.more_setting_soccer_phone_betting_number);

		currentIndex = sharedPreferences.getInt(keyCurrentIndex, 0);

		initList();

	}
	
	@Override
	public ActivityGroupController GetActivityGroupController()
	{
		return MoreGroup.GetActivityGroupHostControl();
	}

}